package vip.xiaonuo.supplier.modular.finance.balancelog.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.supplier.modular.business.businessMain.entity.SupplierBusinessMain;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 账户日志实体
 *
 * @author Mr.wu
 * @date  2025/05/17 11:43
 **/
@Getter
@Setter
@TableName("SUPPLIER_BALANCE_LOG")
public class SupplierBalanceLog extends CommonEntity {

    /** 日志ID */
    @TableId
    @Schema(description = "日志ID")
    private String id;

    /** 日志类型 */
    @Schema(description = "日志类型")
    private String logType;

    /** 账户ID */
    @Schema(description = "账户ID")
    private String logAccountId;

    /** 摘要 */
    @Schema(description = "摘要")
    private String logAbstract;

    /** 入账金额 */
    @Schema(description = "入账金额")
    private BigDecimal logInAmount;

    /** 出账金额 */
    @Schema(description = "出账金额")
    private BigDecimal logPayAmount;

    /** 结算前余额 */
    @Schema(description = "结算前余额")
    private BigDecimal logBalanceBefore;

    /** 结算后余额 */
    @Schema(description = "结算后余额")
    private BigDecimal logBalanceAfter;

    /** 业务单ID */
    @Schema(description = "业务单ID")
    @Trans(type = TransType.SIMPLE, target = SupplierBusinessMain.class, fields = "businessCode", alias = "businessMain", ref = "logBusinessIdName")
    private String logBusinessId;

     /**业务单ID名称 */
    @Schema(description = "业务单ID名称")
    @TableField(exist = false)
    private String logBusinessIdName;

    /** 业务单号 */
    @Schema(description = "业务单号")
    private String logBusinessCode;

    /** 扩展信息 */
    @Schema(description = "扩展信息")
    private String extJson;

    /** 数据归属 */
    @Schema(description = "数据归属")
    private String companyId;
}
